﻿<!DOCTYPE html>  
<html>  
<head>  
    <meta charset="utf8">  
    <title>pjax测试</title>  
    <script type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>  
    <script type="text/javascript" src="../js/jquery.pjax.js"></script>  
    <style type="text/css">  
        #main{border:1px solid red;width: 1000px;height: 500px;margin: 0px auto}  
        .click{margin: 0px auto;text-align: middle;width: 1000px;margin-top: 20px;}  
    </style>  
</head>  
<body>  
<div id="main"></div>  
<div class="click">  
    <button class="red">红色模板ss</button>  
    <button class="green">绿色模板</button>  
</div>  
<h1>asdsad</h1>
<script type="text/javascript">  
    $('button').bind('click',function(){  
        var color=$(this).attr('class');  
        $.pjax({  
          url: '../php/index.php?color='+color,  
          container: '#main'  
        })  
    });  
</script>  
</body>  
</html>  